
#ifndef LATTICE_H
#define LATTICE_H
 
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<fstream>
#include<string>
#include<vector>

//lbe2d
#include "Common.h"
#include "Cell.h"

using namespace std;

typedef vector<Cell> cellVector;
typedef vector<cellVector> CellGrid;

class Lattice {
	private:
		CellGrid grid;
		CellGrid gridNew;

		int dimX, dimY;

		void streamCell(int i, int j);
		void swapGrids();

	public:
		Lattice();
		void init(int nX, int nY, double _rho, double se, double seps, double sq, double snu);

		void update();
		void resetGrid(double _rho);
		void relaxRho();

		//seters
		void setU(int i, int j, double _ux, double _uy);
		void setU(int i, int j, double _ux, double _uy, double _rho);

		//geters (hace falta que digan get?)
		double population();
		double divergence();
		double energy();
};

#endif
